//  Inside Microsoft Exchange 2007 Web Services 
//  Chapter 14
//
//  Copyright (c) 2007 David Sterling, Ben Spain, Mark Taylor, Huw Upshall, Michael Mainer.  
//  All rights reserved.
//
using System;
using System.Collections.Generic;
using System.Text;
using ProxyHelpers.EWS;

namespace IsGreaterThanLeafFilter
{
    class Program
    {
        static void Main(string[] args)
        {
            // Listing 14-3
            // build up our IsGreaterThan leaf filter
            //
            IsGreaterThanType greaterThan = new IsGreaterThanType();
            PathToUnindexedFieldType sizePath = new PathToUnindexedFieldType();
            sizePath.FieldURI = UnindexedFieldURIType.itemSize;
            greaterThan.Item = sizePath;
            FieldURIOrConstantType constant = new FieldURIOrConstantType();
            ConstantValueType constantValue = new ConstantValueType();
            constantValue.Value = "100000";

            // Note that FieldURIOrConstantType.Item is of type object.  This is 
            // because it can take either a ConstantValueType instance or a property 
            // path such as PathToUnindexedFieldType.
            //
            constant.Item = constantValue;
            greaterThan.FieldURIOrConstant = constant;

            RestrictionType restriction = new RestrictionType();
            // Set our IsGreaterThan instance to be the filter associated with our 
            // restriction element
            //
            restriction.Item = greaterThan;
        }
    }
}
